Automated control for detection of flow limitation

ABSTRACT

A respiratory flow limitation detection device, which can include an airway pressure treatment generator, determines a flow limitation measure  506  based one or more shape indices for detecting partial obstruction and a measure of a patient&#39;s ventilation or respiratory duty cycle. The shape indices may be based on function(s) that ascertain the likelihood of the presence of M-shaped breathing patterns and/or chair-shaped breathing patterns. The measure of ventilation may be based on analysis of current and prior tidal volumes to detect a less than normal patient ventilation. The duty cycle measure may be a ratio of current and prior measures of inspiratory time to respiratory cycle time to detect an increase in the patient&#39;s inspiratory cycle time relative to the respiratory cycle time. A pressure setting based on the flow limitation may then be used to adjust the treatment pressure to ameliorate the patient&#39;s detected flow limitation condition.

CROSS-REFERENCES TO RELATED APPLICATIONS

This application is a continuation of U.S. patent application Ser. No.15/151,641 filed May 11, 2016, which is a continuation of U.S. patentapplication Ser. No. 12/599,715, filed May 10, 2011, now U.S. Pat. No.9,358,353, which is a national phase entry under 35 U.S.C. § 371 ofInternational Application No. PCT/AU08/00647, filed May 9, 2008,published in English, which claims priority from U.S. Provisional PatentApplication No. 60/965,172 filed on Aug. 17, 2007 and AustralianProvisional Patent Application No. 2007902561 filed May 11, 2007, all ofwhich are incorporated herein by reference.

FIELD OF THE INVENTION

The presented technology relates to methods and apparatus for thedetection, diagnosis and/or treatment of respiratory conditions such asthe conditions related to sleep apnea hypopnea syndrome (OSAHS) orobstructive sleep apnea (OSA).

BACKGROUND OF THE INVENTION

As described by Sullivan & Lynch in U.S. Pat. No. 5,199,424, issued onApr. 6, 1993, the application of continuous positive airway pressure(CPAP) has been used as a means of treating the occurrence ofobstructive sleep apnea. The patient is connected to a positive pressureair supply by means of a nose mask or nasal prongs. The air supplybreathed by the patient is slightly greater than atmospheric pressure.It has been found that the application of continuous positive airwaypressure provides what can be described as a “pneumatic splint”,supporting and stabilizing the upper airway and thus eliminating theoccurrence of upper airway occlusions. It is effective in eliminatingboth snoring and obstructive sleep apnea and in many cases, is effectivein treating central and mixed apnea.

In U.S. Pat. No. 5,549,106 to Gruenke, issued on Aug. 27, 1996, anapparatus is disclosed that is intended for facilitating the respirationof a patient for treating mixed and obstructive sleep apnea. The deviceincreases nasal air pressure delivered to the patient's respiratorypassages just prior to inhalation and by subsequently decreasing thepressure to ease exhalation effort.

In U.S. Pat. No. 5,245,995 Sullivan discusses how snoring and abnormalbreathing patterns can be detected by inspiration and expirationpressure measurements while sleeping, thereby leading to earlyindication of preobstructive episodes or other forms of breathingdisorder. Particularly, patterns of respiratory parameters aremonitored, and CPAP pressure is raised on the detection of pre-definedpatterns to provide increased airway pressure to, ideally, subvert theoccurrence of the obstructive episodes and the other forms of breathingdisorder.

As described by Berthon-Jones in U.S. Pat. No. 5,704,345, issued on Jan.6, 1998, various techniques are known for sensing and detecting abnormalbreathing patterns indicative of obstructed breathing. Berthon-Jonesdescribes methods based on detecting events such as apnea, snoring, andrespiratory flow flattening. Treatment pressure may be automaticallyadjusted in response to the detected conditions.

As described by Wickham in International Patent ApplicationPCT/AU01/01948 (Publication No. WO0218002), a flow flatteningdetermination may be further based upon different weighting factors. Theweighing factors are applied to sections of the airflow to improvesensitivity to various types of respiration obstructions.

Other methods for detecting obstruction have also been used. Forexample, in U.S. Pat. Nos. 5,490,502 and 5,803,066, Rapport discloses amethod and apparatus for optimizing the controlled positive pressure tominimize the flow of air from a flow generator while attempting toensure that flow limitation in the patient's airway does not occur.Controlled positive pressure to the airway of a patient is adjusted bydetecting flow limitation from the shape of an inspiratory flowwaveform. The pressure setting is raised, lowered or maintaineddepending on whether flow limitation has been detected and on theprevious actions taken by the system.

In U.S. Pat. No. 5,645,053, Remmers describes a system for automaticallyand continuously regulating the level of nasal pressure to an optimalvalue during OSA (Obstructive Sleep Apnea) treatment. Parameters relatedto the shape of a time profile of inspiratory flow are determinedincluding a degree of roundness and flatness of the inspiratory profile.OSA therapy is then implemented by automatically re-evaluating anapplied pressure and continually searching for a minimum pressurerequired to adequately distend a patient's pharyngeal airway.

Despite the availability of such devices for treating OSA, some sleepobstructive events may still go untreated with the use of some devices.Thus, new methods of automated detection and treatment of obstructiveevents may be desirable.

SUMMARY OF THE INVENTION

In an aspect of the present technology, apparatus and methods areprovided with improved automatic detection and/or automatic treatment ofsleep disordered breathing or flow limitation.

In another aspect of the present technology, improved detection and/ortreatment of flow waveforms indicative of partial obstruction isprovided.

In still another aspect of the present technology, apparatus and methodsare provided for a more rapid response to indications of partialobstruction or flow limitation.

In still another aspect of the present technology, apparatus and methodsare provided for qualifying a measure of flow limitation or partialobstruction, such as a flow limited waveform or shape index thereof, bya measured or detected secondary condition of the airway to moreaccurately detect obstructive events.

Aspects of the present technology involve methods for detecting flowlimitation that may include determining a measure of respiratory flow,determining a shape index indicative of a pattern of flow limitationfrom the measure of respiratory flow, determining a ventilation measureor a breath duty cycle measure from the measure of respiratory flow andderiving a flow limitation measure as a function of the determined shapeindex and either or both of the determined ventilation measure and theduty cycle measure.

In certain embodiments, the shape index may be an index of flattening,an index of “M” shaping, an index of a chair shaping and/or roundnessetc. or other index that may be indicative of a partial obstruction. Theventilation measure may be a tidal volume measure such as a ratio of acurrent tidal volume to a prior tidal volume. The breath duty cyclemeasure may be a ratio such as a ratio of a current breath inspirationtime to breath cycle time ratio and a prior average breath inspirationtime to breath cycle time ratio.

The methods may be implemented by flow limitation detectors and/or byflow limitation pressure treatment devices. For example, the methods maybe implemented to adjust treatment pressure of a pressure treatmentdevice, such as by increasing pressure as a condition of the shape indexbeing indicative of the presence of an M shape breath in the respiratoryairflow and the ventilation measure decreasing sufficiently to beindicative of less than normal ventilation. Optionally, the treatmentpressure value may be adjusted or increased as a condition of the shapeindex being indicative of the presence of an M shape breath in therespiratory airflow and an increase of the duty cycle measure.

In one embodiment of the technology, an apparatus to detect flowlimitation may include a patient interface to carry a flow of breathablegas, a flow sensor coupled with the patient interface to generate a flowsignal representing flow of the breathable gas through the patientinterface, and a controller coupled with the flow sensor to process theflow signal, where the controller is configured to control a method ofdetection to derive the flow limitation measure based on the shape indexand either or both of the ventilation measure and the breath duty cyclemeasure. The apparatus may further include a flow generator coupled withthe controller and the patient interface, so that the controller can beconfigured to calculate a pressure request as a function of the flowlimitation measure, and set the flow generator in accordance with thepressure request such as the adjustments described herein.

In one embodiment of the technology, a system for the detection of flowlimitation may include an interface means to carry a flow of breathablegas, a flow measuring means coupled with the interface means forgenerating a flow signal representing flow of the breathable gas throughthe interface means, and a processing means coupled with the flowmeasuring means for processing the flow signal, where the processingmeans is configured for processing a method of detection to derive theflow limitation measure based on the shape index and either theventilation measure or breath duty cycle measure. The system may furtherinclude a flow means, coupled with the processing means and theinterface means, for generating a controlled flow of breathable gasthrough the interface means such that the processing means may beconfigured for calculating a pressure request as a function of the flowlimitation measure, and setting the flow generator in accordance withthe pressure request.

In another embodiment, the technology may be an information-bearingmedium having processor-readable information thereon, such that theprocessor-readable information can control an apparatus for detectingrespiratory flow limitation. The processor-readable information maycomprise control instructions for determining a measure of respiratoryflow, determining a shape index indicative of a pattern of flowlimitation from the measure of respiratory flow, determining aventilation measure and/or breath duty cycle measure from the measure ofrespiratory flow, and deriving a flow limitation measure as a functionof the determined shape index and either or both of the determinedventilation measure and breath duty cycle measure. Theprocessor-readable information may further comprise instructions forcalculating a pressure request as a function of the flow limitationmeasure and making adjustments to pressure as described herein.

Another aspect of the present technology involves the generation ofpressure or flow control information or signals that are derivedproportionally as a function of a measure of flow limitation. Forexample, a controller or processor may be configured to control ordetermine a pressure setting or flow rate setting for a respiratorytreatment device. Based on a measure of respiratory flow, an obstructionmeasure or a shape index representing a degree of obstruction or flowlimitation may be determined or calculated by the apparatus. Theapparatus may further optionally determine a ventilation measurerepresenting a degree of change in ventilation from the measure ofrespiratory flow. The treatment pressure setting or flow rate settingmay be derived by the apparatus as a proportional function of either orboth of (1) the degree of obstruction or flow limitation and (2) thedegree of change in ventilation.

Further embodiments of the technology will be apparent from thefollowing disclosure.

BRIEF DESCRIPTION OF DRAWINGS

The present technology is illustrated by way of example, and not by wayof limitation, in the figures of the accompanying drawings, in whichlike reference numerals refer to similar elements including:

FIG. 1 shows air flow of a patient first breathing normally, thenexperiencing airway collapse and finally arousing;

FIG. 2 shows a flattening index in reference to a patient experiencingobstruction indicated by an “M” shape breathing pattern;

FIG. 3 shows flattening indices with and without multi-breath averagingin reference to a patient experiencing obstruction indicated by an “M”shape breathing pattern leading to a breathing pattern indicative of thepatient's arousal from sleep;

FIG. 4 shows example components of an apparatus for detection and/ortreatment of flow limitation or partial obstruction;

FIG. 5 illustrates suitable steps for a detection or treatment device indetecting flow limitation or partial obstruction;

FIG. 6 shows example fuzzy membership functions for variables based on asingle breath flattening shape index;

FIG. 7 shows example fuzzy membership functions for variables based onan m-shape breath shape index;

FIG. 8 shows example fuzzy membership functions for variables based on aventilation ratio index;

FIG. 9 shows example fuzzy membership functions for variables based on abreath duty cycle ratio;

FIG. 10 shows example output membership functions for a flow limitationmeasurement;

FIG. 11 shows and example de-fuzzification operation in thedetermination of a flow limitation or partial obstruction measure usinga centroid method;

FIG. 12 shows an example function for modifying the detection capabilityof the flow limitation or partial obstruction measure based on a measureof ventilation;

FIG. 13 is a graphical comparison of a traditional flattening index witha calculated flow limitation measure FFL of the technology describedherein determined from the same flow signal;

FIG. 14 shows a flow signal derived from nasal flow and the outputmeasure of a continuous RERA detector quantifying the likelihood of arespiratory arousal;

FIG. 15 illustrates a ratio of peak to mean expiratory flow that may bean index of sleep-wake-arousal detection;

FIG. 16 is two superimposed filtered and unfiltered flow signalsrecording a sequence of obstructive breaths in the presence of alow-frequency snore;

FIG. 17 illustrates a response of an example FIR filter useful forfiltering an airflow signal;

FIG. 18 plots example functions to serve as basis vectors B1 & B2 fordetecting M-shape breathing;

FIG. 19 is a graph of the flow signal for a typical M-shaped breath;

FIG. 20 is a graph of a flow signal showing an M-shape breath augmentedby a simple chair shaping;

FIG. 21 is a graph of a membership function for a variable based on aratio of peak to mean inspiratory flow useful for detecting M-shapebreaths having a chair shape;

FIG. 22 is a graph of a membership function for a variable based on aninspiratory peak location useful for detecting M-shape breaths having achair shape;

FIG. 23 shows a graph of a flow signal, a graph of a determined measureof flatness and a graph of a determined measure of chair shaping;

FIG. 24 shows a graph of a flow signal of a patient experiencing upperairway resistance with increasing breathing effort terminating in sleeparousal at t=420 and a corresponding graph of a single breath flatteningindex;

FIG. 25 shows a graph of an example flow-limitation measure, ventilationmeasure and duty cycle measure based on the flow signal of FIG. 24;

FIG. 26 is a graph of a persistent obstruction measure or persistentflattening measure based on the sequence of breaths shown in the flowsignal of FIG. 24;

FIG. 27 illustrates a function for a de-weighting factor that can beutilized for modification of a flow limitation measure;

FIG. 28 presents a graph of a respiratory flow signal, a graph of aninstantaneous snore signal and a graph of three snore indices;

FIG. 29 shows a classifier for treating snore based on multiple snoreindices;

FIG. 30 is a graph of an M-shape breath with correct and incorrect trimresults indicated thereon;

FIG. 31 includes a graph of a flow signal verses time including m-shapebreaths and a graph of determined inspiratory time made by two methods;

FIG. 32 shows graphs of functions useful for de-weighting a measure offlow limitation depending on leak conditions;

FIG. 33 is a further function useful for de-weighting the flowlimitation measure or partial obstruction measure (e.g., FFL) based onleak conditions;

FIG. 34 is a graph of a function suitable for de-weighting a flowlimitation or partial obstruction measure by a level of mask pressure;

FIG. 35 is a graph of a function suitable for de-weighting a flowlimitation or partial obstruction measure by a measure of jamming;

FIG. 36 is a graph of a function suitable for de-weighting a snoremeasure as a function of treatment pressure;

FIG. 37 is a graph of a function suitable for de-weighting a snoremeasure based on a ventilation measure indicative of a big breath;

FIG. 38 is a histogram of normalized expiratory peak location forvarious groups of patients; and

FIG. 39 is a graph of a function of a de-weighting factor to be appliedto a flow limitation or partial obstruction measure based on anormalized expiratory peak location value.

DETAILED DESCRIPTION

Patients with OSA have recurrent apnoeas or hypopnoeas during sleep thatare only terminated by the patient arousing. These recurrent eventscause sleep fragmentation and stimulation of the sympathetic nervoussystem. This can have severe consequences for the patient includingday-time sleepiness (with the attendant possibility of motor-vehicleaccidents), poor mentation, memory problems, depression andhypertension. Patients with OSA are also likely to snore loudly, thusalso disturbing their partner's sleep. The best form of treatment forpatients with OSA is constant positive airway pressure (CPAP) applied bya blower (compressor) via a connecting hose and mask. The positivepressure prevents collapse of the patient's airway during inspiration,thus preventing recurrent apnoeas or hypopnoeas and their sequelae.

Ordinarily a patient will undergo two sleep studies where they aremonitored using many sensors, the recording of which is known as apolysomnogram. The first study (without therapy) confirms the diagnosisof OSA, while the second is used to titrate the patient to the correcttherapy pressure.

Pressure requirements vary throughout the night because of changes inposition, posture and sleep state. The physician will recommend apressure (the titration pressure) likely to cover any eventuality. Analternative to this is an automatic machine that adjusts the pressure tothe patient's needs; this therapy is known as automatic positive airwaypressure or APAP. An advantage of APAP therapy is that it is adaptableto pressure requirements that may change over many time scales. Forexample, pressure requirements change during the night with posture andsleep state, perhaps over the weekend with alcohol consumption, overmonths because of the beneficial effect of the therapy itself and overthe course of years because of weight loss or gain. Also, because anAPAP machine typically raises the pressure when it is needed, thepatient can go to sleep with a comfortable pressure much lower than anytherapeutic maximum. Finally, because APAP machines work at potentiallylower pressures, the effects of mask leaks tend to be amelioratedsomewhat.

A known algorithm that is used to automatically set patient pressure inAPAP machines is called ResMed AutoSet. All in all, the AutoSet device,and its algorithm, is excellent for treating OSA patients. The ResMedAutoSet algorithm responds to three things: flow limitation, snore(audible noise) and apnoea. Setting automatic pressure is also describedin U.S. Pat. No. 5,704,345, the contents of which are hereby expresslyincorporated herein by cross-reference. Flow-limitation is a fluiddynamic property of so called “collapsible tubes” conveying a fluidflow. The pharynx in patients with OSA is an example of a collapsibletube (albeit a muscular one rather than a simple passive tube beingstudied on a bench top). In essence, flow-limitation is a condition in acollapsed tube conveying a flow where (given that the upstream pressureis held constant) the flow is no longer increased by decreasing thedownstream pressure (i.e., an increase in the flow-driving differentialpressure). In patients with a collapsed upper airway this equates to asituation where the patient is no longer receiving adequate ventilationand yet increases in breathing effort no longer increase the inspiratoryflow-rate. FIG. 1 shows an example of such a patient first breathingnormally at 102, then experiencing airway collapse at 104 and, despitemore negative excursions in oesophageal pressure (a measure of breathingeffort), not managing to increase tidal volume or flow-rate. Eventuallythe patient arouses at 106 in order to open the airway and takes a fewbig breaths to restore blood-gas homeostasis.

The ResMed AutoSet algorithm monitors patient flow and raises pressurewhen it detects flow limitation or snore. Because apnoeas are normallypreceded by periods of flow limitation (also called partial obstruction)or snoring, apnoeas are rarely encountered. As a backup measure,pressure is also raised if an apnoea is detected. In the absence of anymeasured flow disturbance, the pressure is allowed to decay slowly andhopefully an equilibrium pressure will be achieved that allows thepatient to sleep arousal-free. The AutoSet algorithm respondsproportionally and so a metric is used for each condition to which itresponds. The metrics used are: a flattening index for flow-limitation,a calibrated RMS measure of sound averaged over an inspiration for snoreand the length of any apnoea detected.

A flattening index is a non-dimensional feature (e.g., a real number)calculated using a patient's inspiration waveform. It attempts tomeasure essentially how flat-topped the waveform is. A feature of flowlimitation is that while the downstream pressure is sufficiently low tokeep the tube collapsed the flow-rate will be more or less maintained ata constant value, regardless of changes to the driving pressure. In apatient with flow-limited breathing this equates to an inspiratorywaveform with a flat top (i.e., a constant inspiratory flow-rate.)

For example, depending on the chosen scale of the index, normalbreathing can produce a flattening index of around 0.2 while a severelyflattened waveform can produce a flattening index of about 0.1 or less.For APAP therapy a limit is typically established (e.g., 0.19 in somemachines) and the pressure is raised in proportion to how far theflattening index is below the threshold. In order to reduce the effectsof noise and increase specificity, a typical pressure setting algorithmmay also use a five breath point-wise moving average. A possibledisadvantage of the five breath average is that it slows down thedetection of flow-limitation because five abnormal breaths need to beaveraged before flattening may fall to its final nadir. Three heuristicweightings can be applied to the threshold at which flattening willcause the pressure to rise, such that greater reductions in flatteningare required: as the leak increases, as the therapy pressure rises andas evidence of valve-like breathing increases. These heuristics serve toprevent potential pressure runaway in the face of degraded information(flow signal).

While a flattening index is an excellent measure of flow-limitation, itis designed to detect certain situations. However, in some particularimplementations it has been observed not to address some raresituations. The following lists areas where we have made suchobservations:

1. A five-breath moving average slows down the detection offlow-limitation. This is illustrated in FIG. 2. In FIG. 2, the top traceshows a plot of a traditional five-breath moving-average flatteningindex. The bottom trace shows a measure of respiratory flow. The patientbegins to obstruct mildly and the flattening trace descends in staircasefashion at 202 due to the five-breath average. To the right of the graphthe obstruction becomes more severe and progressively more “M” in shape.As shown, the flattening index eventually starts to reverse directionand increase rather than decrease with worsening obstruction.

2. Because different inspiratory shapes can average to give a completelynew shape, the five breath moving average can have consequences. This isillustrated in FIG. 3. FIG. 3 shows a sequence of so called, M-shapedobstructed breaths at 302 ending in an arousal at 304 followed by somereasonably normal recovery breaths at 306. As shown in the graph, bothsingle-breath flattening and traditional flattening are high at the endof the sequence of M-breaths (the former getting to the maximum valuequicker) and that after the arousal, traditional flattening actuallyfalls below 0.1, not because the breaths are flattened, rather becausethe M-breaths averaged with the normal breaths to produce a pseudo-flatshape.

3. The flattening index is not designed to detect M breaths. In fact,the flattening index goes high when M-shaped breaths occur. This isillustrated in FIGS. 2 and 3.

4. The flattening index can cause a pressure increase regardless ofcurrent ventilation or sleep state of the patient-user of the device.

5. The heuristics applied to de-weight flattening might also result inunder-treatment in some patients.

6. The flattening index is subject to normal random variations that haveconsequences for the sensitivity and specificity of any algorithm thatuses it to detect flow-limitation.

Although M-shaped breaths may be rare, it may still be desirable todevelop further methods and devices for detecting flow-limitation and/orimprove existing methods and devices.

In reference to FIG. 4, the present technology involves a pressuredelivery and/or flow limitation detection device that may include a flowgenerator such as a servo-controlled blower 402. The device willtypically also include a patient interface such as a mask 406 and an airdelivery conduit 408 to carry a flow of air or breathable gas to and/orfrom a patient. The blower 402 may be coupled with the air deliveryconduit 408 and the mask 406. Exhaust gas can be vented via exhaust 413.Optionally, a flow sensor 404 f and/or pressure sensor 404 p may also beutilized. For example, mask flow may be measured using apneumotachograph and differential pressure transducer or similar devicesuch as one employing a bundle of tubes or ducts to derive a flow signalF(t). Also mask pressure may be measured at a pressure tap using apressure transducer to derive a pressure signal P_(mask)(t). Thepressure sensor 404 f and flow sensor 404 p have only been shownsymbolically in FIG. 4 since it is understood that other configurationsand other devices may be implemented to measure flow and pressure. Theflow F(t) and pressure P_(mask)(t) signals may be sent to a controlleror microprocessor 415 via one or more analog-to-digital (A/D)converters/samplers (not shown) to derive a pressure request signalP_(request)(t).

Alternatively, a flow signal f(t) and/or pressure signal P_(mask)(t) maybe estimated or calculated in relation to the blower motor by monitoringcurrent (I) supplied to the motor, the speed (S) and/or revolutions (w)of the motor with or without the provision of flow and pressure sensorsas described above. Optionally, the blower motor speed may be heldgenerally constant and pressure changes in the mask may be implementedby controlling an opening of a servo-valve that may variably divert/ventor deliver airflow to the mask. Furthermore, other types of patientinterface may be used in place of the mask and the flow and/or pressuresensors may measure flow and pressure in alternative locations withrespect to the patient interface.

The controller or processor 415 is configured and adapted to implementthe methodology or algorithms described in more detail herein and mayinclude integrated chips, a memory and/or other control instruction,data or information storage medium. For example, programmed instructionswith the control methodology may be coded on integrated chips in thememory of the device or such instructions may be loaded as software orfirmware using an appropriate medium.

With such a controller, the apparatus can be used for many differentpressure treatment therapies by adjusting the pressure delivery equationthat is used to set the speed of the blower or to manipulate the ventingwith the release valve and may be based on detection methodologiesinvolved in the pressure delivery equation as illustrated in the exampleembodiments detailed herein. Alternatively, they may be implemented in adevice without the pressure treatment components such that the devicemay be used to diagnose, detect and/or quantify the existence of flowlimitation.

The methodologies or algorithms presented herein for detecting and/ortreating breathing patterns indicative of partial obstruction can beimplemented with the controller as a fuzzy logic control system.Generally, fuzzy logic is a way for transforming ideas for systembehavior into computer code that is based on real numbers for theparameters of a control system. However, the problem at hand isbasically one of statistical pattern recognition and may be implementedusing other techniques such as the alternatives discussed in more detailherein. Therefore, while the following technology is presented in termsof a fuzzy logic control system, it is understood that there are otherways of implementing the methodologies into a control system based onthe desired control inputs and the exemplary output functions.

To this end, an embodiment of the control system of the presenttechnology can be implemented according to the following generalapproach using a partial obstruction or flow limitation measure such asa Fuzzy Flow-Limitation (FFL) measure. Using such a measure is anapproach that may remedy some of the observations previously describedwith respect to the use of traditional flattening indices as a systemcontrol variable. The flow limitation measure FFL uses multiple featurepattern recognition to improve the sensitivity and specificity of thealgorithm's response to flow-limitation (or more properly: partialupper-airway obstruction). In an embodiment, the general approach withthe flow limitation measure FFL may include some or all of the followingsteps:

1. Monitor the patient's respiratory flow.

2. Extract inspiratory and expiratory waveforms from the flow signal.

3. Calculate features from each component of the waveform or, whereappropriate, from the combined waveform. Multiple features may beconsidered to constitute a pattern.

4. Calculate fuzzy input variables from the raw variables. This stepconstitutes a mapping of an input variable to a new space. Data miningof a suitable cohort of patients allows good estimation of the parameterspace.

5. Combine the derived fuzzy variables using fuzzy logic to producefuzzy outputs. This step can be formulated using a matrix that allowsintuitive understanding by the layperson.

6. De-fuzzify the fuzzy outputs to produce a crisp value (real number)to be used by the pressure control algorithm.

7. Combine fuzzy outputs from multiple sources.

8. Adjust treatment pressure based on the FFL result.

In accordance with this methodology, an example system maps inputparameters that vary widely in range to variables that can be readilyinterpreted with fuzzy logic principles. For example, a shape index suchas a flattening index may be mapped to the fuzzy variables such as HIGHFLATTENING, NORMAL FLATTENING and LOW FLATTENING, etc. Each of thesevariables would take a value between zero and one, depending on thevalue of the flattening index as determined by mathematical functionsassociated with the variables and based on the input data associatedwith a flattening determination such as respiratory airflow. Similarly,other fuzzy variables can map a ventilation measure such as HIGHVENTLATION, NORMAL_VENTILATION and LOW_VENTILATION, etc., based onappropriate mathematical functions and input data associated withdetermining ventilation. Still other fuzzy variables can also map arespiratory duty cycle measure (e.g., a ratio of time of inspiration(T_(i)) to the total time of a breathing cycle (T_(tot))) such asT_(i)-on-T_(tot)_LOW, T_(i)-on-T_(tot)_NORMAL, or T_(i)-on-T_(tot)_HIGH,etc. These variables may be further mapped to fuzzy outputs that in turnmay be used to generate control variables. Fuzzy outputs associated witha flow limitation measure may be, for example, MILD, MODERATE and SEVEREand may be based on other fuzzy variables such as the previouslymentioned examples. For example, the fuzzy logic controller mayimplement the conditions represented by example statements such as:

-   -   (a) IF (LOW_FLATTENING & LOW_VENTILATION) then flow-limitation        is SEVERE.    -   (b) IF (HIGH_FLATTENING & T_(i)-on-T_(tot)_HIGH) then        flow-limitation is MILD.

The de-fuzzified output, which can be used as a flow limitation measure,can be implemented to range between zero (no flow-limitation) and one(severe). With such a system, the input space can be classified in anon-linear sense using readily interpretable rules without any loss ofreal-number precision.

Indeed, with the precision of such a flow limitation measure, whichrepresents a degree of obstruction over a continuous range from 0 to 1,the measure can be implemented proportionally to derive a responsepressure or flow control setting well suited to treat the conditiondetected with the measure. For example, without needing to utilize athreshold that would otherwise be compared to such a measure todetermine whether or not a pressure adjustment should be made, themeasure may be more directly implemented in the setting of a respiratorytreatment apparatus or determining of a treatment setting for such adevice. For example, the obstruction measure may serve as a proportionalfunction that may be directly applied to a pressure adjustment quantityor flow rate adjustment quantity (e.g., measure*adjustment quantity).The resultant adjustment quantity could then be applied to a treatmentsetting of a respiratory treatment apparatus. As discussed with respectto the technology described in more detail herein, an “FFL” measure maybe implemented to serve as such a proportional treatment settingfunction.

As further illustrated in FIG. 5, in such a system flow limitation maybe detected and/or quantized by a method that includes (a) determining ashape index indicative of a pattern of flow limitation from the measureof respiratory flow shown in step 502; (b) determining a ventilationmeasure or a breath duty cycle measure from the measure of respiratoryflow shown in step 504; and (c) deriving a flow limitation measure as afunction of the determined shape index and either or both of thedetermined ventilation measure or the determined breathing cycle measureshown in step 506. With such a method, sophisticated adjustments to thetreatment pressure may be made. For example, increases to treat flowlimitation may be based on a condition such that a pressure change canoccur if it is determined that both (a) a shape index is indicative ofthe presence of an M shape breath or flattened breath in the respiratoryairflow and (b) the ventilation measure is decreasing sufficiently to beindicative of less than normal ventilation. Additional increases totreat flow limitation may be based on another condition such that apressure change can occur if it is determined that both (a) the shapeindex is indicative of the presence of an M shape breath in therespiratory airflow and (b) an increase of the duty cycle measure isdetected. With such conditions, a suitable treatment response may beprovided without an unnecessary treatment change that could otherwiseoccur when the shape index, ventilation measure or breathing duty cyclemeasure taken alone do not accurately predict a level of flowlimitation.

Accordingly, in one embodiment, the system may be characterized by theuse of a plurality of input features (e.g., 4) for deriving the flowlimitation measure FFL. The input features may include (1) asingle-breath flattening (SBF) shape index, (2) an M shape index (MS),(3) a ventilation measure such as a ventilation-ratio (VR) and/or (4) arespiratory duty cycle measure such as the ratio of inspiratory time tothe total breath time (T_(i)-on-T_(tot)).

An embodiment of a shape index implemented as a single breath flatteningindex SBF may be calculated similar to the approach disclosed in U.S.Pat. No. 5,704,345 except that it is preferably performed without usinga five-breath moving-average. The details of an implementation of asingle breath flattening shape index determination are disclosed insection A herein.

An exemplary implementation of a determination of an M-shape shape indexis described in section B herein. The illustrated calculation of theM-shape feature can vary in the range from zero (i.e., the inspiratoryflow waveform is not M-shaped) to one (i.e., the inspiratory flowwaveform is definitively M-shaped). The M-shape index may optionally beaugmented by another shape index such as a simple “chair-shape” index.An exemplary determination of the chair-shape index (e.g., Fuzzy“Chairness”) is also detailed in section B.

An embodiment of a determination of a suitable ventilation measure maybe based on a tidal volume calculation. For example, the ventilationmeasure may be a ratio including a current tidal volume and a priortidal volume such that the measure can be indicative of changes inventilation or tidal volume. In one suitable embodiment, the measure maybe a ventilation ratio VR that can be calculated as follows:

1. Take the absolute value of the respiratory flow and filter it with asimple low-pass filter (time-constant=three minutes).

2. Divide the filter output by two to give “3 minute ventilation.”

3. Calculate the respiratory tidal volume (essentially the mean of theinspired and expired volumes).

4. Divide the tidal volume by the length of the breath—giving meanbreath flow-rate—and then divide this value by the 3 minute ventilationgiving a measure of how this breath compares to recent ventilation.

Ordinarily, the VR will oscillate over a small range of about one. Inthe event of severe upper-airway obstruction, it will descend to valuesmuch less than one and can descend to zero for total obstruction. Bigbreaths (recovery breaths on arousal) will have a VR much greater thanone (e.g., 1.5-2). Further details for a calculation of the particularventilation ratio VR are included in Section G herein.

As previously mentioned, the system can optionally utilize a respiratoryduty cycle measure in the derivation of flow limit measure FFL. Themeasure may be based on a ratio of a current and prior duty cycle sothat it can be indicative of changes in the respiratory duty cycle.Exemplary details for the calculation of a respiratory duty cycle ratioTTR are further described in Section G herein. For example, a suitablebreath duty cycle measure can be based on the calculation of aT_(i)-on-T_(tot) variable. The chosen variable has the (implausible)limits of zero (no inspiration) and one (no expiration). Because thebase T_(i)-on-T_(tot) can vary from patient to patient, a ratio ofT_(i)-on-T_(tot) to its recent mean value is calculated which has beendesignated herein a T_(i)-on-T_(tot) ratio. The recent mean value ofT_(i)-on-T_(tot) can be calculated by feeding each T_(i)-on-T_(tot)value calculated into a simple low-pass filter. When T_(i)-on-T_(tot) isincreasing relative to recent history, the TTR will exceed one.T_(i)-on-T_(tot) has values around 0.4 while TTR will be one ordinarilyand greater than one when patients are trying to “compensate”, i.e.,increase their tidal volume in the face of an obstructed upper airway.

As previously mentioned, these input features are mapped by mathematicalfunctions into several variables. Thus, the shape index SBF can bemapped into, for example, six fuzzy variables: B_LOW_FLATTENING,EXTRA_LOW_FLATTENING, VERY_LOW_FLATTENING, LOW_FLATTENING,NORMAL_FLATTENING and HIGH_FLATTENING. These fuzzy memberships are shownby the sample functions that have been graphed in FIG. 6 and have beenpresented in the order from left to right in conjunction with eachvariable listed respectively above. As an example application of themembership functions, if shape index SBF is computed and results in avalue of 0.05, when applied to each of the membership functions, thevariable B_LOW_FLATTENING would result in a value of 1.0 and a value ofzero for all of the other fuzzy variables in the graph of FIG. 6. Othersuitable functions and variables may be selected as desired.

Similarly, example membership functions and variables based on thecomputation of the M-shape shape index are shown in FIG. 7. This graphpresents suitable functions for LOW_M-SHAPE, NORMAL_M-SHAPE,HIGH_M-SHAPE, VERY_HIGH_M-SHAPE and B_HIGH_M-SHAPE. Example membershipfunctions and variables based on the computation of the ventilationratio index are shown in FIG. 8. This graph presents suitable functionsfor VERY_LOW_VENTILATION, LOW_VENTILATION, NORMAL_VENTILATION,HIGH_VENTILATION and VERY_HIGH_VENTILATION. Finally, example membershipfunctions and variables based on the computation of the breath dutycycle ratio are shown in FIG. 9. This graph presents suitable functionsfor T_(i)-on-T_(tot)_LOW, T_(i)-on-T_(tot)_NORMAL, T_(i)-on-T_(tot)_HIGHand T_(i)-on-T_(tot)_VERY_HIGH and T_(i)-on-T_(tot)_EXTRA_HIGH.

Based on some or all of these mapped variables, a system may then applyor evaluate rules based on combinations of the variables in thederivation of the flow limitation measure FFL. For example, fuzzy ruleshave been illustrated in the tables below based on the prior identifiedfuzzy variables. These matrices also express an idea of what mayconstitute partial obstruction in natural language.

TABLE A Flattening and Ventilation Measure Flattening measure (low =good, high = bad) Low Normal High Very High Extra High B HighVentilation Very High Zero Negative Zero Zero Zero Zero Ratio High ZeroNegative Zero Zero Zero Zero Measure Normal Zero Zero Zero Zero Mild Mto M (high = Low Zero Zero Mild M to M Moderate M to S good) Very LowZero Zero M to M Moderate M to S Severe

Table A summarizes a set of fuzzy rules that may be applied with thefuzzy variables associated with the single breath flattening shape indexand the ventilation ratio measure. For example, the rule in bold (“M toM”, i.e., Mild to Moderate) in the “Very High” column with respect toflattening shape index's fuzzy variables and the “low” row with respectto the ventilation ratio measure's fuzzy variable represents the fuzzyrule:

if (VERY_HIGH_FLATTENING AND LOW_VENTILATION) then FFL is“Mild-to-Moderate”.

This and the other rules represented in the table can be evaluated,where the “AND” is a fuzzy-and. Common output results for each outputresponse (e.g., “Mild-to-Moderate”) may then be fuzzy-or-ed together.For example, the two rules with “moderate” outputs (e.g., a measure of amoderate flow limitation) would be fuzzy-or-ed to give the final“moderate” output. This is the equivalent of the following equation:

moderate=(VERY_HIGH_FLATTENING AND VERY_LOW_VENTILATION) OR(EXTRAHIGH_FLATTENING AND LOW_VENTILATION)

Based on the application of these rules in the derivation of the flowlimitation measure at least three things are evident in itsimplementation: 1) as flattening severity increases (e.g., the shapeindex decreases) the FFL measure increases, 2) where flattening isoccurring and ventilation is decreasing, the FFL measure is even moresevere, and 3) where ventilation is high (e.g., recovery (big) breathsetc. are occurring) the response to flattening shape index is tempered.

There are cases where flow-limitation (at least initially) does notinvolve a reduction in tidal volume (e.g., the ventilation ratio). Inthese cases a patient maintains his or her tidal volume by increasingthe duty cycle, i.e. by stretching the inspiration time as a percentageof the overall inspiration-expiration time. This trend can be measuredor determined using a duty cycle measure (e.g., TTR) which in thisembodiment will increase above one as the inspiration time lengthens.

The system may further combine flattening shape index information with abreath duty cycle measure (e.g., TTR) in a similar manner as it had beencombined with a ventilation measure (e.g., VR) using the rulesrepresented by the following table B.

TABLE B Flattening and Breath Duty Cycle Measure Flattening measure (low= good, high = bad) Low Normal High Very High Extra High B HighTi-on-Ttot Low Zero Negative Zero Zero Zero Zero Ratio Normal ZeroNegative Zero Zero Zero Zero Measure High Zero Zero Mild M to M ModerateM to S (high = Very High Zero Zero M to M Moderate M to S Severe bad)Extra High Zero Zero Moderate M to S Severe Severe

Like table A, table B represents fuzzy rules as well as a correspondingnatural language description of flow obstruction based on the measure ofbreath duty cycle and the flattening shape index. For example, the rulein bold (“M to S”, i.e., Moderate to Severe) in the “Extra High” columnand the “Very High” row is the fuzzy rule:

if (EXTRA_HIGH_FLATTENING AND T_(i)-on-T_(tot)_VERY_HIGH) then FFL isModerate-to-Severe.

This rule represents a consideration that if the wave shape of theinspiratory breathing pattern is tending to severely-flat and theinspiration is moderately stretched by consideration of the duty cyclemeasure then the flow limitation measure FFL is Moderate-to-Severe. Asmentioned with respect to table A, the result of the rules for commonoutput functions of this table can be combined using the fuzzy-oroperation.

In a manner similar to the way that the flow limitation measure isderived using the flattening shape index information and either or bothof a ventilation measure and a breath duty cycle measure, the flowlimitation may also be derived by using both M-shaping and/or AugmentedM-shaping detection indices and either or both of the ventilation orbreath duty cycle measures. Aspects of this derivation are illustratedin tables C and D.

TABLE C M-Shaping or Augmented M-Shaping and Ventilation MeasureM-shaping or Aug. M-shaping (low = good, high = bad) Low Normal HighVery High Extra High B High Ventilation Very High Zero Negative ZeroZero Zero Zero Ratio High Zero Negative Zero Zero Zero Zero MeasureNormal Zero Zero Zero Zero Mild M to M (high = Low Zero Zero Mild M to MModerate M to S good) Very Low Zero Zero M to M Moderate M to S Severe

Table C represents rules like the rules of the prior charts except thatthey relate to the fuzzy variables based on the M-shaping shape indexand/or the chair-shape index. As evident from the nature of theselection of output functions in the table, the rules in part areintended to prevent a response to a detected M-shape breathing patternwhere the patient has a normal or above average ventilation. Thus, theflow limitation measure is derived so that the system will not respondto certain types of arousal breaths and “behavioral” M-shape breathingpatterns such as those that can occur during REM sleep but are notindicative of a current flow limitation. For example, the rulerepresented by the entry in the top row of the last column of table Cindicates that the output function is “zero” for a bad “B High” M-shapeindex related measure when there is a good ventilation measure (e.g.,“Very High”).

Furthermore, most M-shaped breaths represent moderate-to-severeobstruction and will exhibit a ventilation decrease. Thus, other rulesof table C permit a detection of flow limitation for a pressure changeof the system to address this situation of a detected M-shape breath anda low ventilation measure such as a decrease in ventilation.

As mentioned with respect to table A, the result of the rules for commonoutput functions of this table can be combined using the fuzzy-oroperation.

Table D presents rules involving the breath duty cycle measure.

TABLE D M-Shaping or Augmented M-Shaping and Duty Cycle MeasureM-shaping or Aug. M-Shaping (low = good, high = bad) Low Normal HighVery High Extra High B High Ti-on-Ttot Low Zero Negative Zero Zero ZeroZero Ration Normal Zero Negative Zero Zero Zero Zero Measure High ZeroZero Mild M to M Moderate M to S (high = Very High Zero Zero M to MModerate M to S Severe bad) Extra High Zero Zero Moderate M to S SevereSevere

Table D represents particular fuzzy rules as well as a correspondingnatural language description of flow obstruction or measures of flowlimitation derived from the measure of breath duty cycle and theM-shaping and/or the augmented M-shaping determinations. In thisexample, the matrix “combines” the M-shape information with theT_(i)-on-T_(tot) Ratio (rather than ventilation ratio). The matrix maybe considered to relate to breaths that exhibit M-ness, or a degree ofthe existence of an M-shape pattern, in the presence of a trend ofincreasing breath duty cycle. This combination identifies flowlimitation in breaths where the patient's ventilation is about “normal”and the patient is “compensating” by taking longer inspirations.

As mentioned with respect to table A, the result of the rules for commonoutput functions of this table can be combined using the fuzzy-oroperation.

Results of the rules applied based on tables A, B, C and D maythereafter be applied to output functions. FIG. 10 shows suitable fuzzyoutput membership functions that may be applied with the results. Theoutput membership functions include NEGATIVE, ZERO, MILD,MILD_TO_MODERATE, MODERATE, MODERATE_TO_SEVERE and SEVERE.

As an example, consider table D. Once the individual fuzzy rules in thetable have been calculated (e.g., if (EXTRA_HIGH_MSHAPE ANDT_(i)-on-T_(tot)_VERY_HIGH) then FFL is Moderate-to-Severe), the outputsare collected and fuzzy-Or-ed together. For example, there are threeModerate-to-Severe outputs in table D that would need to be fuzzy-Or-ed.Once this is done for all the outputs, they are supplied to thedefuzzification functions in FIG. 10 and the centroid method may be usedto provide a crisp output as per FIG. 11. This results in a real numberbetween 0 and 1.25. Once the individual outputs from all the tables areavailable, the maximum output may be used for the value of FFL.

In determining a single “crisp” measure in a de-fuzzification step asjust mentioned, a centroid method or other such de-fuzzificationoperation may be performed. In the centroid method, the crisp value ofthe output variable is determined by finding a value associated with thecenter of gravity of the values for the output functions. An example ofsuch a method is illustrated in FIG. 11. FIG. 11 illustrates anapplication of the centroid method calculated for fuzzy inputs whereMILD=0.1, MILD_TO_MODERATE=0.5, MODERATE=0.8. The calculated result is0.61064. Those skilled in the art will understand other ways tocalculate the crisp measure in view of the present description.

In one embodiment of the system, the flow limitation measure may bederived so as to avoid treatment of other potential detected conditions.For example, it is possible for an arousal breath to be flat in shape orM-shaped, thus potentially indicative of a flow limitation based on adetermination with the shape indices, but the breath actually may be ofa stretched inspiratory time and thus not indicative of actual flowlimitation in the patient. Thus, the flow limitation measure may bederived so as not to treat such a breath as flow limited. One manner ofdoing so is to modify the fuzzy outputs of the fuzzy rules from tablesA, B, C, and D so as to adjust the combinations that use the breath dutycycle measure TTR with the function illustrated in FIG. 12. Essentially,the fuzzy outputs resulting from the rules based on a combination of theduty cycle measure TTR (e.g., the rules of tables B and D) aremultiplied by the output of the function of FIG. 12 beforedefuzzification. Thus, if the ventilation ratio is approximately one orless, the result of each particular rule is left unchanged. As theventilation ratio measure VR increases, which indicates an increasinglikelihood of an arousal breath, the output of the rules of tables B andD are progressively de-weighted according to the example function ofFIG. 12 and by the multiplication operation until the ventilation ratiomeasure VR approaches 1.5. At that point, the result of themultiplication operation will render the output of the affected rules tobe zero.

Based on the foundation of the foregoing building blocks (e.g., shapeindices, fuzzy membership functions and variables, fuzzy rules etc.) acalculation of an embodiment of the flow limitation measure FFL in aflow limitation detection system can be further summarized with thefollowing exemplary steps:

1. Breaths may be framed up from the patient flow signal in a typicallyway so as to distinguish and extract data representing inspiratory andexpiratory waveforms from a flow signal.

2. The inspiration waveform may optionally be trimmed of any leadingpause using a trimming method that allows for particular M-shapes. Sucha method is described in section F herein.

3. The M-Shape and Fuzzy-Chairness determinations may be made based onthe exemplary calculations illustrated in section B.

4. An augmented M-shape may optionally be calculated as the Fuzzy-OR ofthe M-shape shape index and the chair shape index (e.g.,Fuzzy-Chairness).

5. A filtered single-breath flattening (SBF) shape index may bedetermined based on the exemplary calculations illustrated in section A.

6. Ventilation ratio (VR) and T_(i)-on-T_(tot) ratio (TTR) may bedetermined based on the exemplary calculations illustrated in section G.

7. SBF, VR, TTR & augmented M-shape may fuzzified into variables as perthe exemplary membership functions previously described.

8. Fuzzy rules may then be applied according to the matrices of tablesA, B, C, and/or D as previously described.

9. Fuzzy rules from tables B and D that use the breath duty cyclemeasure TTR may be optionally modified by the “Limit Arousal Breaths”function previously described with respect to FIG. 12.

10. Each fuzzy rule matrix is collected and defuzzified as detailedabove separately.

11. This results in the following fuzzy outputs that are all fuzzy-OR-edto give a flow limitation measure FFL such as:

FFL=fuzzy-OR(SBF-VR,SBF-TTR,M-shape-VR, M-shape-TTR)

Where:

-   -   SBF-VR is the deffuzzified result based on the rules of table A;    -   SBF-TTR is the deffuzzified result based on the rules of table        B;    -   M-shape-VR is the deffuzzified result based on the rules of        table C; and    -   M-shape-TTR is the deffuzzified result based on the rules of        table D;

12. Next a Fuzzy Persistent Flattening measure (FPF) may optionally becalculated and fuzzy-OR-ed with flow limitation measure FFL by thefollowing equation. Exemplary calculations of the measure FPF isdescribed in section C herein. The adjustment of the FFL measure can bemade by the following equation:

FFL=fuzzy-OR(FFL,FPF)

13. FFL is now modified according to the extent that the breath framing(e.g., the detection of inspiration or expiration waveforms) might befalse such as utilizing the calculations described in section D herein.The resulting incorrect breath framing factor may be multiplied by theFFL by the following equation:

FFL=FFL*Bad-breath-framing-factor

14. This final FFL value may optionally be used in a ring buffer of alength, such as three, and the value of FFL that is ultimately used by apressure setting algorithm can be based on a running average of the mostrecent FFL values of the buffer. A suitable equation for this operationmay be:

${FFL} = {\left( {\sum\limits_{i = 1}^{3}{FFL}_{i}} \right)/3}$

FIG. 13 provides a graphic comparison between a traditional flatteningindex and a derived flow limitation measure FFL in accordance with stepsof the above summary. The index and measure are based on the same flowsignal shown in the bottom trace. The bottom trace flow signal includesa sequence of obstructed breaths ending in an arousal followed by somereasonably normal recovery breaths, and then some more obstruction. Thebreaths are initially “flat” and then progressively more M-shaped. Inthe top trace, the traditional flattening index initially falls thenrises and finally falls sharply during the recovery breaths. The flowlimitation measure FFL of the middle trace rises steadily both due toflattening and the M-ness shape of the breaths and then falls to zerowhen breathing in the flow signal becomes more normal.

The flow limitation measure may also be implemented in the control of apressure treatment device. In one such embodiment, the measure may beimplemented with any one or more of the following as follows:

1. Measure flow-rate at the flow generator (FG).

2. Measure pressure at the FG.

3. Using the flow-rate in step 1 calculate the pressure drop between theFG and the mask.

4. Calculate the pressure at the mask as the pressure at the FG minusthe pressure drop calculated in step 3.

5. Using the pressure at the mask, calculate the flow through the ventin the mask (sometimes called intentional leak).

6. Subtract the vent flow from the flow measured at the FG to give thesum of patient flow (respiratory flow) plus any unintentional (mask ormouth) leak.

7. Filter the signal from step 6 to extract the DC (unintentional leak)component.

8. Subtract the DC component calculated in the last step from the flowcalculated in step 6 to give patient flow (respiratory flow).

9. Filter patient flow lightly to remove unwanted higher frequenciessuch as by the method illustrated in section H herein.

10. Frame up breaths using patient flow in the usual way.

11. Any leading pause is trimmed from the front of the inspiration suchas by the method illustrated in section F herein.

12. Once a complete breath has been framed (inspiration+expiration)calculate the following features:

-   -   a. Length of any apnoea preceding the breath    -   b. The inspiratory snore index (e.g., the mean of a snore signal        over the course of the currently analyzed inspiration).    -   c. The value of the filtered single-breath flattening index        (SBF) for the currently analyzed breath such as by the method        illustrated in section A herein).    -   d. The value of the M-shape index for the current inspiration        and the value of fuzzy-chairness for the current inspiration        such as by the method described in section B herein. The values        of M-shape and fuzzy-chairness are fuzzy-OR-ed to give the        augmented M shape feature.    -   e. The value of the ventilation ratio (VR) and the        T_(i)-on-T_(tot) ratio (TTR) for the currently analyzed breath        such as by the method described in section G herein.    -   f. Using SBF, VR, TTR & augmented M calculate FFL as detailed        above.    -   g. Using the currently analyzed expiration, calculate valve-like        leak ratio.    -   h. Measure the unintentional leak at the end of the currently        analyzed expiration.    -   i. Lookup the current setting for mask pressure, (i.e., the        EPAP).    -   j. Using the currently analyzed expiration, calculate the        normalized expiratory peak location NEPL such as by the method        described in section K herein.    -   k. Look up the value of recent peak jamming.

13. The de-weighting factor is calculated as per the followingpseudocode.

Section J describes example individual de-weighting functions that maybe utilized.

-   -   a. deweight=1.0    -   b. deweight*=FFL_function_of_Leak (leak)    -   c. valve-like leak*=valve_like_leak_function_of_leak (leak)    -   d. deweight*=FFL_function_of_valve_like_leak (valve-like leak)    -   e. deweight*=FFL_function_of_pressure (EPAP)    -   f. deweight*=FFL_function_of_NEPL (NEPL)    -   g. deweight*=FFL_function_of_Jamming (jamming)

14. The current threshold required for a pressure rise(current_crit_FFL) is then calculated using:

Current_crit_FFL=1.0−deweigAht*(1.0−crit_FFL);

15. The standard value of the unmodified crit_FFL is 0.05. So if, afterall de-weightings are applied, deweight=1.0 then current_crit_FFL=0.05.Alternatively, if deweight=0.0 then current_crit_FFL=1.0.

16. The value of the pressure rise associated with FFL (the FFL“module”) can now be calculated and “prescribed”:

  a. dp = 1.0 * (FFL − current_crit_FFL) b. if (dp > 0.0) then {  max_dp= (EPAP-range-max − EPAP)  if (dp > max_dp) then dp = max_dp  if (dp >0.0) then FFL-prescription += dp } else FFL_prescription = decay(FFL_prescription, Ti+Te, 20)The last step simply decays the pressure exponentially over the time ofthe breath with a time-constant of preferably about 20 minutes.

17. Now the pressure rise due to snore may be calculated and“prescribed” and may utilize individual de-weighting functions asillustrated in section J herein:

  a.Current_crit_snore = Snore_function_of_Pressure (EPAP) b. Insp_snore*= Snore_function_of_VR (VR) c. if (Insp_snore > Current_crit_snore)then {  dp = 1.5 * (Insp_snore − Current_crit_snore)  max_dp1 = ttot *0.2  if (dp > max_dp1) then dp = max_dp1  max_dp2 = ( EPAP_range_max −EPAP )  if (dp > max_dp2) then dp = max_dp2  if (dp > 0.0) thensnore_prescription += dp } else snore_prescription = decay(snore_prescription, Ti+Te, 20)

18. Now the pressure rise due to apnoea may be calculated:

if ((apnoea_airway_closed && (apnoea_duration > 10)) then {  Head_room =(Max_Pressure_Apnoea − EPAP)  if (head-room > 0.0) then  {   new_epap =Max_Pressure_Apnoea −    head_room * exp(-ExpRiseTimeApnoea *   apnoea_duration)   if (new_epap > EPAP_range_max) then    new_epap =EPAP_range_max   apnoea_prescription += (new_epap − EPAP)  } } elseapnoea_prescription = decay (apnoea_prescription, Ti+Te, 20)

19. The new EPAP setting may then be calculated:

a. EPAP=EPAP range min+apnoea prescription+snoreprescription+FFL-prescription

b. The new EPAP setting may then be achieved by raising the FG pressurein such a way that the mask pressure approaches the new EPAP value at amaximum slew-rate of 1.0 cmH₂0 per second. Also, the treatment pressureis preferably only raised while the patient is in inspiration.

In still another embodiment of the technology, the flow limitationmeasure FFL may optionally be implemented as part of a respiratoryeffort related arousal (RERA) detector. In 1999 the AASM Task Forcedefined RERAs as:

-   -   “A sequence of breaths characterized by increasing respiratory        effort leading to an arousal from sleep, but which does not meet        criteria for an apnea or hypopnoea. These events must fulfill        both of the following criteria:    -   1. Pattern of progressively more negative esophageal pressure,        terminated by a sudden change in pressure to a less negative        level and an arousal    -   2. The event lasts 10 seconds or longer.”

In 2000, the study “Non-Invasive Detection of Respiratory Effort-RelatedArousals (RERAs) by a Nasal Cannula/Pressure Transducer System” done atNYU School of Medicine and published in Sleep, vol. 23, No. 6,p/763-771, demonstrated that a Nasal Cannula/Pressure Transducer Systemwas adequate and reliable in the detection of RERAs.

By utilizing the technology described herein, a RERA detector may bebased on a real flow signal derived from a flow-generator. For example,a flow limitation measure by any of the methods previously described maybe determined based on a flow signal. A measure of arousal may then bederived as a function of the flow limitation measure and a furtherfunction of a measure of an increase in ventilation.

Thus, in one embodiment, the RERA detector may be based on the followingmethodology:

-   -   if there has been flow limitation recently (e.g., FFL is greater        than (>)0) followed by a ventilation step change (e.g., a big        breath) then a RERA is detected.

Preferably, the measure is implemented as a continuous variable so thatadjustments to a threshold based on experimental data can be made. Thismay be an alternative to a Boolean threshold on each input parameterwhich results in lost information). The following algorithm may be used:

1. Keep track of the three most recent FFL values in a rolling buffer.

2. Keep track of the three most recent ventilation ratios (VR is theratio of the mean tidal volume to the current three minute ventilation).

3. Sum the three most recent FFL values and limit the result to therange [0.0:1.0].

4. Calculate the two most recent VR differences (i.e., VR_(n)−VR_(n-1)and VR_(n)−VR_(n-2)).

5. Take the maximum of step 4 while limiting it to a value greater thanor equal to zero.

6. Multiply the result of step 3 by the result of step 5 to give theRERA result.

7. The result of step six may be normalised by taking the square root ofthe result.

8. A threshold could be set where, if the result of step seven exceedsthe threshold, a RERA is scored.

9. There should be breath(s) with a RERA score below the thresholdbetween breaths which are scored as RERAs.

10. The buffer size is chosen as three because in extreme cases of UARSthere are only three detectable breaths between arousals.

As shown in FIG. 14, the bottom signal represents a continuous RERADetector measure based on this methodology. The bottom trace show adetection of a respiratory effort related arousals based on the arousalsof the top trace showing a flow signal.

The RERA Detector may be further implemented as part of a respiratorydisturbance index. The RERA detector could be further used to calculatean RDI (Respiratory Disturbance Index in a diagnosis mode such as by theequation:

RDI=RERAs+Apnoeas+Hypopnoeas per hour

Alternatively, RERAs could be reported by a therapy device as anindication of the effectiveness of the therapy. Finally, the RERA indexdescribed herein could be used as input into a therapy algorithm. Forexample, the RERA index could be determined over a certain time frame,such as per hour, and the result may be used in an “outer loopcontroller” to set the threshold (or gain) for flow-limitation indicesraising pressure. An example of an outer loop controller is described inWO 2005/051470 (PCT/AU2004/001652) assigned to ResMed Ltd., thedisclosure of which is hereby incorporated herein by reference.

A ratio of peak to mean expiratory flow may be used as another type ofindex of sleep-wake-arousal detection. The ratio of peak expiratory flowto mean expiratory flow may be part of the sleep-wake/arousal detection.FIG. 15 includes a histogram comparing awake normals with two sleepdatasets. Awake breaths tend to be “flatter”, i.e., the peak is closerin value to the mean. By comparing a threshold, such as 0.5, with theratio, a RERA may be considered to be detected.

Section A—Single Breath Flattening

One embodiment of a single breath flattening index may be calculated bythe following method as follows:

1. Frame up breaths.

2. Extract the inspiration part of the breath.

3. Trim any trailing or leading pause as required.

4. Interpolate the resulting inspiration over a standard grid of Npoints (normally N=65).

5. Divide the point y values by a factor such that the breath area isnormalized to one with unity base length.

6. Calculate the rms value of the difference of the middle half of thepoints from one.

The flow signal that is used to calculate flattening may be called(amongst other things) “patient flow”. This flow signal can be theresult of filtering a raw flow signal with a filter such as a “10 Hz”filter although filter types may vary. The filter preferably reducesunwanted signal content such as that caused by turbulent flow and snore.The filter may also attenuate cardiogenic content slightly. The filteris a trade off between accurately detecting zero crossing points on theone hand and rejecting unwanted signal on the other. For example, if thefilter were made more aggressive to reject all cardiogenic oscillations,breath detection could be rendered inaccurate. However, once breathdetection is complete, further filtering may occur as desired.

Optionally, a filtered single breath flattening may be determined by thefollowing:

1. Raw flow is filtered in the normal way to give patient flow.

2. Patient flow is used to frame breaths as usual.

3. Patient flow is continuously fed to an FIR filter that furtherattenuates unwanted signal components.

4. Because the FIR filter will have constant phase delay with frequency,we can pick the points required for the flattening calculation by simplyaccounting for the filter's delay.

5. Calculate flattening in the normal way.

FIG. 16 shows two superimposed flow signals recording a sequence ofobstructive breaths where the normal calculation of flattening might becorrupted by (in this case) low-frequency snore. One of the signals hasbeen filtered (and delay compensated) such that the snore is notevident. The filtered signal will give appropriately lower values offlattening calculated on a signal breath basis when compared to acalculation based on the other signal in which the snore is evident.

In the illustrated signals of FIG. 16, the last breath has traditionalflattening values calculated as: 0.21 (based on the unfiltered signal)and 0.13 (based on the filtered signal). The latter value is indicativeof a required pressure rise while the former is not indicative of apressure rise. As an alternative to such filtering, a traditionalfive-breath point-wise averaging may also achieve this filtered resultbut at the expense of significant response delay.

A typical (and non-computationally-intensive) filter to use is a boxcarFIR filter. A boxcar filter of length 12 has a response illustrated inFIG. 17 at a sampling frequency of 50 Hz. The impulse response of thefilter is not critical if there is a concern primarily with the signalof the middle half of each inspiration.

Section B—M-Shape Index and Augmented M-Shape

A suitable method for determining an obstruction measure such as anM-Shape index may be accomplished with the following algorithm. Theindex detects the presence of “M” shaped breath patterns. Such an indexmay also be commonly considered an indicator of “u” shaped breathpatterns. The obstruction measure may also be augmented or modified byan additional obstruction measure. For example, as will be described inmore detail herein, an index of obstruction may be derived as a functionof a first obstruction measure, such as an “M” shape index, and a secondobstruction measure, such as an “h” or chair shape index.

For example, in some embodiments, each inspiration can be interpolatedover a grid of N points, such as N=65. In this embodiment, two basisfunctions are calculated as:

t=i/(N−1) where i goes from 0to N−1.

B1=sin(πt)

B2=sin(3πt)

These basis functions can then be stored for use with all subsequentcalculations of the M-shaped index.

Each inspiration is then extracted and interpolated over a grid of Npoints. Two factors are then calculated as:

F1=sum(B1·fs)

F2=sum(B2·fs)

Where fs represents the interpolated inspiration points and · is thedot-product operator.

The final shape value is obtained by normalizing as:

${{shape}\mspace{14mu} {index}} = \frac{F_{2}}{\sqrt{F_{1}^{2} + F_{2}^{2}}}$

This shape factor is then limited to vary between zero (purelysinusoidal) to one (very M-shaped). FIG. 18 plots suitable functions toserve as basis vectors B1 & B2.

The flow signal for a typical M-shaped breath is plotted in the graph ofFIG. 19. Based on the above methodology, calculations for the plottedbreath are as follows:

F1=4.6082

F2=2.6538

Shape index=0.50

A typical non-flow-limited breath can have an M-shape index of onlyabout 0.2.

As previously described, an M-shape breath may be augmented by a simplechair shaping. This is illustrated in FIG. 20, which plots a flow signalhaving flow limitation that produces the augmented shape. Theflow-limited inspiration shown in FIG. 20 (from t=0 to approximately t=2seconds) has a typical “chair” shape. Such inspirations can becharacterized by two features: 1) a high ratio of peak to meaninspiratory flow and 2) a normalized peak location close to either 0 (aleft-backed chair as illustrated in FIG. 20) or 1 (a right-backed chairnot shown)). In one embodiment, these indices can be are calculated asfollows: Normalized Inspiratory Peak location (NormPeakLoc):

${NormPeakLoc} = \frac{\left( {t_{peak} - t_{0}} \right)}{\left( {t_{end} - t_{0}} \right)}$

Where:

t₀ is the time at the start of inspiration;

t_(end) is the time at end inspiration; and

t_(peak) is the time at the peak inspiratory flow rate.

Ratio of Peak to Mean Inspiratory Flow (RPMIF):

RPMIF=Q_(peak)/Q′

Where:

Q_(peak) is the maximum flow rate during the inspiration; and

Q′ is the mean flow rate over the inspiration.

During quiet sleep a normal inspiration will have a normalized peaklocation of approximately 0.5 and a ratio of peak to mean inspiratoryflow of 1.35. To measure “chairness”, fuzzified versions of thesefeatures are utilized based on the graphs of FIGS. 21 and 22. Theresults of the above equations are applied to the mathematical functionsof the respective graphs.

Once these fuzzy variables have been calculated, the final FuzzyChairness index is calculated as the fuzzy and of the results asfollows:

Fuzzy_Chairness=Fuzzy-AND(Fuzzy_Peak_to_Mean,Fuzzy_Peak_Loc).

Based on this determination, the inspiration of FIG. 20 has a fuzzychairness of 0.82. The scaling of the fuzzy chairness feature is suchthat it can be fuzzy OR-ed directly with the M-shape feature for acombined shape index. A fuzzy chairness of approximately greater than0.3 implies flow-limitation. Fuzzy chairness can be described in Englishas: “if the ratio of the peak of inspiration to the mean of inspirationis high AND the location of peak inspiratory flow is near the beginningor end of inspiration THEN the inspiration is chair shaped.” In FIG. 23,a typical flow sequence is shown where the inspiratory shape isinitially flat such that an SBF index is approximately less than 0.2.However, the shape turns chair-shaped such that the SBF index (SBflattening) is approximately greater than 0.2 but the Fuzzy Chairness orthe chair-shape index is approximately greater than 0.3.

Section C—Persistent Flattening

While the example flow-limitation measure FFL outlined above is designedto react to flow-limitation with both high sensitivity and specificityin a timely fashion, there are cases where it potentially fails toprevent arousal due to increased upper airway resistance. Consider thetraces shown in FIG. 24 of a patient experiencing upper airwayresistance with increasing breathing effort terminating in arousal fromsleep at t=420 (big breath in upper panel). The lower panel of FIG. 24shows a single-breath flattening index.

FIG. 25 shows why the FFL flow-limitation measure did not cause thepressure to rise in this sequence. The patient is maintaining theirtidal volume (e.g., VR approximately 1) without stretching theirinspiratory time as a function of total breath time (e.g., TTRapproximately 1). Hence, despite a single-breath flattening indexattaining low values, an FFL flow limitation measure fails to reachlevels needed to raise the pressure adequately.

In order to deal with this situation, the system may optionallyimplement another obstruction measure. For example, a first obstructionmeasure may be derived from filtering a second obstruction measure suchas a flattening index. This can provide an apparatus with some historicvalue associated with past obstruction. Optionally, the historic valuemay be reset if normal breathing is achieved (e.g., no obstruction) sothat the history or filtered obstruction measure is an indicator ofcontinuous or persistent past obstruction.

For example, a “fuzzy persistent flattening” may be implemented. As thename suggests, this fuzzy persistent flattening measure respondsessentially to consistently low values of the flattening index. Themeasure is also implemented to respond slowly relative to the FFL flowlimitation measure so that it does not interfere with the flowlimitation measure FFL and over-treat the patient. Thus, the systempreferably filters a single-breath flattening index in the followingway:

A simple first order auto-regressive digital filter can be used such asone of the form:

Y_(n)=y_(n-1)+G(x_(n)−y_(n-1))

Where:

G is the gain of the filter.

A time constant twice as fast as five breaths in length may beestablished. So, for example, initially if a breath is considered 4seconds long:

${{Time}\mspace{14mu} {Constant}} = {\tau = {\frac{5 \times 4}{2} = 10}}$

In order to allow for the fact that breaths might not be four seconds inlength, a breath detection algorithm may be used to get the currentrespiration rate (RR, breaths per minute) which can be determined as anaverage of the five most recent breaths detected. This can beimplemented as an adaptive time constant given by:

$\tau = \frac{5 \times 60}{2{RR}}$

So, if RR is 15 breaths per minute, which can be a common RR, the timeconstant would calculate to be 10 as before.

A suitable gain of the filter is given simply by:

$G = \frac{1}{\tau}$

The value to be filtered is a (filtered) single-breath flattening index.In order to prevent spurious values from corrupting the filteringprocess the system may optionally “head-limit” the incoming values.Thus, the values may be determined as a head limited flattening (HLF)index as follows:

if (SBF index>0.3) then

HLF=0.3

else HLF=SBF index.

The output of the filter is a Persistent Flattening index (PF), and itcan be initialized to an arbitrarily high value so that initially it hasno effect on treatment such as: PF=1

Another feature of the filter is that a different gain is used forinputs that are less then the current value of PF than for values thatare greater then the current value of PF as follows:

if HLF<PF then

PF=PF+G(HLF−PF)

else

PF=PF+3*G(HLF−PF)

This non-symmetry means that the filter will descend slowly to anypersistently low inputs but will reset relatively quickly. This helpsimprove the noise threshold such that only consistently low values offlattening are responded to in a time frame shorter than the flowlimitation measure FFL.

Next the value of PF is prevented from wandering away from a reasonablevalue with the following:

if (PF>0.2) then

PF=0.2

else PF=PF

Finally, PF may be mapped to a fuzzy variable—fuzzy persistentflattening (FPF) such as by using the following equation:

${FPF} = \left( {{PF} > {0.19\mspace{14mu} {then}\mspace{14mu} 0.0\mspace{14mu} {else}\frac{0.19 - {PF}}{0.19 - 0.05}}} \right)$

FIG. 26 illustrates the response of FPF to the same sequence of breathsshown in FIG. 24.

Section D—Bad Breath Framing

Occasionally a breath detection algorithm can frame up breathsincorrectly or a patient will cough or swallow causing a breath thatprovides little information about the current state of the airway. Anoptional heuristic may be used to de-weight breaths that are unlikely tobe relevant based on the inspiratory time. Thus, a derived obstructionmeasure may be adjusted if a breath pattern that indicative of aninaccurately framed breath is detected. For example, FIG. 27 illustratesa function for a de-weighting factor that can be multiplied by a flowlimitation measure (e.g., FFL). Breaths which are determined to beunrealistically long (T_(i)>2.5 sec) or short (T_(i)<0.7 sec) areprogressively de-weighted.

Section E—Snore Entropy

Traditionally snore has been measured using the calibrated inspiratorysnore index, which may be considered a measure of obstruction. FIG. 28shows a typical sequence of snores captured while a patient was asleep.The upper panel shows respiratory flow-rate, the middle panelinstantaneous snore (e.g., a measure of the acoustical power in thefrequency range of interest) and the lower panel shows three snoreindices. The calibrated inspiratory snore index (labeled “snore index”in FIG. 28) is calculated as follows:

-   -   the inspirations are framed up using the respiratory flow signal    -   the instantaneous snore signal is adjusted to allow for        background noise due to current conditions (e.g., set pressure,        turbine speed etc.)    -   the snore index is calculated as the mean of the instantaneous        snore signal over the course of each inspiration (i.e.,        approximately the mean acoustical power for each inspiration).

This technique is reliable when used to treat snore by raising the maskpressure in proportion to the measured snore index. However, thetechnique requires that calibration constants be measured for eachflow-generator-mask combination and stored in non-volatile memory of theapparatus. Such calibrations are time-consuming and hence costly and maybe subject to change with time.

Matthew Alder et al. teach in PCT Application number PCT/AU2007/000002an alternative, labeled delta snore in FIG. 28. Delta snore iscalculated as the difference between the mean of the instantaneous snoresignal during inspiration minus the mean of the instantaneous snoresignal during expiration. This is in essence a self calibration measurethat assumes the background noise sources will vary little betweeninspiration and expiration. However, this is not always true.

In another alternative method, an inspiratory snore entropy method isimplemented. In one example, this measure of obstruction is determinedby filtering a measure of respiratory flow in a frequency rangeassociated with snoring (e.g., 30 to 300 Hz). The magnitude of the poweror energy of the filtered signal in the frequency range is then examinedas a function of time to assess whether the power signal is indicativeof some inspiratory shape or whether it is simply random noise. Forexample, a Shannon entropy function may be used. If the functionindicates that the energy signal is merely random information or noise,then the snore index may be adjusted or de-weighted since real snoringmay not be occurring.

Such a method uses the information contained in the instantaneous snoresignal during inspiration. Such an index also does not requirecalibration, For example, the obstruction measure may be calculated asfollows:

-   -   assemble a vector S of length n containing the instantaneous        snore values for the inspiration in question    -   if n<2 or n>an arbitrarily large value, give up and return zero    -   subtract the floor of the snore vector and add one:

S=S−min(S)+1

-   -   calculate the area A:

$A = \frac{\sum\limits_{i = 1}^{n}\; S_{i}}{n}$

-   -   if A is <an arbitrarily very small value give up and return zero    -   normalize the snore vector:

$S = \frac{S}{A}$

-   -   calculate the Shannon entropy (se) of the normalized snore        vector:

${{se} = {\frac{1}{\ln (2)}\frac{\sum_{i = 1}^{n}\; {S_{i}\mspace{11mu} {\ln \left( S_{i} \right)}}}{n}}},{S_{i} > 0}$

-   -   optionally, the result may be scaled to approximate the        inspiratory snore index as:

inspiratory snore entropy=10.0*se

Both delta snore and snore entropy are plotted in the lower panel ofFIG. 28. As illustrated, the “snore entropy” trace tends to pick upspiky snores that have a low mean snore value (t=100). A judiciouscombination of both delta snore and snore entropy was found to correctlyclassify snores in nearly all cases. The graph of FIG. 29 shows one sucharrangement. The classifier denoted by the plotted line can be statedas: “if delta snore is positive then treat, else if delta snore isnegative then require progressively higher snore entropy with negativedelta snore to treat.”

Section F—Improved Trim Leading Pause

Some pressure treatment devices contain a function known as“trim_leading_pause”. This function was designed to trim the front ofthe currently framed inspiration so as to remove any dangling expiratorypause from the previous expiration by detecting a peak and extrapolatingbackwards to an appropriate zero crossing that would be indicative of abeginning of inspiration. This function can fail on M-shaped breaths asillustrated in FIG. 30. FIG. 30 shows an incorrect trim (on the secondpeak) and a correct trim (on the leading peak).

The method can be modified such that it sets a boundary on where thepeak of inspiration can be found that can assist with M-shape breaths.Thus, in case of an M shaped breath, the beginning of inspiration isdetermined by extrapolation from a first peak rather than a second peakof the inspiratory portion of the breath based on a boundary withininspiration. For example, this boundary may be calculated as follows:

1. Find the sum of the inspiration:

vol=Σ_(t) ₀

(t)dt

2. Find the point in the inspiration turn such that:

Σ_(t) ₀ ^(t) ^(lim)

(t)dt>0.4×vol

3. Find the peak of the inspiration within [t₀:t_(lim)]

4. Proceed with the current trim_leading_pause algorithm.

The plot of FIG. 31 shows a sequence of flow-limited breathing in a flowsignal with a number of breaths similar to that shown in FIG. 30. Thetop panel of FIG. 31 shows flow-rate plotted vs. time, the bottom panelshows the calculated inspiratory time (T_(i)) with trim_leading_pauseapplied. Both the current algorithm and the new algorithm (“corrected”T_(i)) results are shown. It can be seen that the current algorithm cutssome breaths in half resulting in artificially and incorrectly lowvalues of T_(i). The new algorithm implements “trim_leading_pause” in aconsistent fashion.

Section G—Ventilation and Duty Cycle Measures

(1) Calculation of Ventilation Ratio (VR)

A ventilation measure, such as the Ventilation Ratio (VR), may bedetermined as the ratio of the current breath-wise ventilation to therecent medium-term ventilation (V₃). In this example, medium-term can bea ventilation measure filtered using a filter with a three minute timeconstant τ. However, other time constants may be suitable. The filterused may be a simple first-order auto-regressive filter. Because thetime constant of the filter is reasonably large, the filter will takesome time to rise from zero. The measure will thus transition slowlybetween the reasonable ventilation value and the filter output duringthe time [t₀:3×τ]. VR can be calculated as follows:

1. Set the gain of the filter to:

$G = \frac{1}{f_{s}\tau}$

Where:

f_(s) is the sampling frequency;

τ is the time constant in seconds of the filter.

For example, if the sampling frequency is 50 hz and the time constant is3 minutes then the G is calculated by:

$G = \frac{1}{50 \times 180}$

2. Initialize the filter to a reasonable ventilation value such as 0.2liter/second.

3. Calculate patient respiratory flow (Q_(p)), that is total flow minusvent flow minus any mask leak, filtered appropriately.

4. Calculate medium-term ventilation:

V₃=V₃+G(Q_(p)−V₃)

5. During the transition period 0<t≤3r:

$V_{3} = {{\frac{{3\tau} - t}{3\tau} \times 0.2} + {\frac{t}{3\tau} \times V_{3}}}$

6. Frame up the breaths in the usual way.

7. Once inspiration is confirmed, calculate the following:

inspired volume: V_(i)

inspiratory time: T_(i)

mean inspiratory flow-rate:

Q _(i)=V_(i)/T_(i)

inspiratory component of ventilation ratio:

VR_(i)=Q _(i)/V₃

8. Once expiration is confirmed, calculate the following:

expired volume: V_(e)

expiratory time: T_(e)

mean expiratory flow-rate:

Q _(e)=V_(e)/T_(e)

expiratory component of ventilation ratio:

VR_(e)=Q _(e)/V₃

9. Calculate VR as follows:

${VR} = \frac{{{VR}_{i}T_{i}} + {{VR}_{e}T_{e}}}{T_{i} + T_{e}}$

(2) Calculation of a Duty Cycle Measure (e.g. TTR)

A duty cycle measure may be implemented for deriving a measure ofobstruction as previously discussed. For example, from a measure ofrespiratory flow second ratio of duration of an inspiratory portion of arespiration cycle to duration of the respiration cycle as a function ofthe measure of respiratory flow. Similarly, a second such measure may bedetermined which may be subsequent in time to the first measure. Themeasure of obstruction may then be derived as a function of the firstratio and the second ratio.

A suitable duty cycle measure such as the T_(i)-on-T_(tot) ratio (TTR)may be determined as the ratio of the current (breath) T₁-on-T_(tot)value to the recent medium-term T_(i)-on-T_(tot) value. Medium-term canbe determined by filtering with a five minute time constant or othersuitable time constant. The filter can be a simple first-orderauto-regressive filter. TTR may be calculated as follows:

1. Set the gain of the filter to:

$G = \frac{1}{f_{s}\tau}$

Where:

f_(s) is the sampling frequency;

τ is the time constant in seconds of the filter.

For example, if the sampling frequency is 0.25 hz (the approximatebreath frequency) and the time constant is 5 minutes then the G iscalculated by:

$G = \frac{1}{\frac{1}{4} \times 300}$

2. Initialize the filter to a reasonable value such as 0.4.

3. Calculate patient respiratory flow (Q_(p)), that is total flow minusvent flow minus any mask leak, filtered appropriately.

4. Calculate medium-term T_(i)-on-T_(tot) as follows:

T_(i)T_(tot(5))=T_(i)T_(tot(5))+G(T_(i)T_(tot)−T_(i)T_(tot(5)))

5. Calculate TTR as follows:

${TTR} = \frac{TiTtot}{{TiTtot}_{5}}$

Section H—De-weighting functions

The functions graphed in FIGS. 32 and 33 can be used to de-weight theeffect of a measure of flow limitation (e.g., FFL) or a measure ofsnore. The function can be applied to increase the threshold of themeasures (e.g., FFL or snore) that needs to be exceeded for a pressurerise to occur. For example, a de-weighting function may involve avalve-like leak ratio. A valve-like leak measure can be calculated in acustomary way such that its value varies between 0 and 5. In order toprevent spurious valve-like leak from preventing pressure rise whenthere is in-fact no leak occurring, the system may be implemented tode-weight a valve-like leak value to the extent that there is noabsolute leak present. So the algorithm for determining de-weighting dueto valve-like leak is as follows:

1. Calculate valve-like leak from the latest inspiration.

2. Determine the absolute value of the leak (the value at endexpiration).

3. Multiply the value of valve-like leak by the output of a function ofabsolute leak such as the function illustrated by the graph at the leftside of FIG. 32. For example, if the absolute leak is less than (<)0.025 valve-like leak is set to zero. Alternatively if the absolute leakis greater than (>) 0.05 the value of valve-like leak remains unchangedand in the interval between 0.025 and 0.05 the value of valve-like leakis linearly diminished.

4. Use the value of valve-like leak with a function of leak such as thefunction illustrated in the graph at the right side of FIG. 32 to outputa de-weighting factor. For example, for values less than (<) 4 theoutput is 1 and for values greater than (>) 5 the output is zero. In theinterval between 4 and 5 the output decreases linearly from one to zero.

The de-weighting of the flow limitation measure (e.g., FFL) based onleak (e.g., L/s) can be done using the function shown in the graph ofFIG. 33. For values of leak less than (<) 0.5 there is no de-weightingand the output is 1. For values of leak greater than (>) 0.7 there iscomplete de-weighting and the output is zero. There is a linear decreasein output from 1 to 0 for value of leak between 0.5 and 0.6.

The de-weighting of the flow limitation measure by pressure, such as thelevel of mask CPAP in cm H₂0, may also be accomplished using a functionsuch as the example graphed in FIG. 34. In the example, for pressurelevels less than 10 cm H₂O there is no de-weighting and for pressuresgreater than 15 cm H₂O there is partial de-weighting and the output is0.8. For pressures between 10 and 15 there is a linear decrease of theoutput from one to 0.8. The output may then be multiplied by the measureof flow limitation.

Finally, the effect of the measure of flow limitation or obstruction canbe de-weighted with increasing Jamming. Jamming is a measure such as thefuzzy extent to which the current inspiration or expiration have beengoing on for too long. For example, Jamming may be determined by themethodology described in U.S. Pat. No. 6,484,719, the disclosure ofwhich is incorporated herein by reference. High jamming is indicative ofa transient change in the leak, for example, when a patient opens theremouth or when they shift in bed and change their mask position on theface. At high levels of jamming it is likely that the flow estimate isnot accurate and that the leak constant is being reduced to help improvethe flow estimate. While this is happening it is prudent to preventpressure rises until things have calmed down. This can be accomplishedby the example function of FIG. 35. When jamming reaches 0.25 the systemcan begin de-weighting until the measure is completely de-weighted at ajamming level of 0.5. The output of the function may be multiplied bythe measure of flow limitation to effect the de-weighting.

Similarly, a measure of snore may be de-weighted based on variousconditions of the system. For example, a value of snore may bede-weighted by the function of pressure illustrated in FIG. 36. Thismakes the system less sensitive to the snore measure for purposes ofgenerating a pressure rise. Thus, the value of snore required for a risein treatment pressure increases with increasing pressure.

The inspiratory snore index can also be de-weighted by a measure ofventilation such as a measure of a “big-breath.” Big breaths ofteninduce noise simply due to the high peak flows achieved. Utilizing theexample function of FIG. 37, ventilation may be utilized to generate ade-weighting output factor depending on whether the ventilation measureis considered to be a big breath. For example, a ventilation measuresuch as the ventilation ratio (VR) may be used as a measure of bigbreaths. Values of VR greater than (>) 1 may be taken as indicatingbreaths that are large compared to the medium term ventilation. Forvalues of VR less than (<) 1.2 the system may refrain from de-weightingany measure of snore and for values of VR greater then (>) 1.5 thesystem may completely de-weight the effect of snore. For values of VRbetween 1.2 and 1.5 the output de-weighting factor may decrease linearlyfrom one to zero.

Other calculations to modify the effect of the flow limitation or snorebased on the leak values, pressure, jamming and/or ventilation measuresmay also be utilized.

Section I—Normalized Expiratory Peak Location

A normalized expiratory peak location (NEPL) is a good indicator of atransition from sleep or obstructed sleep flow waveforms to waveformsindicative of wake, arousal or other unnatural, out-of-the-ordinary orunrecognizable events such as severe mouth leak. Thus, an apparatus ofthe present technology may implement a measure of arousal based on apeak expiratory flow. For example, depending on the location of a peakexpiratory flow or normalized peak expiratory flow within an expiratoryportion of a respiratory cycle, an arousal may be assessed. In such anembodiment, the time of the expiratory portion may be defined by rangesand the occurrence of the peak within the defined ranges defines anindex that is indicative of arousal. The index may be indicative ofarousal if the expiratory peak occurs in a latter time portion or rangeof the expiratory portion of the respiratory cycle.

Such an index may be calculated as follows:

1. Frame up breaths.

2. Isolate the expiratory portion of each breath.

3. Locate the time at which peak expiratory flow occurred.

4. Divide the time from the beginning of the expiration to the peak bythe total expiratory time, e.g., the index is in the range [0.0:1.0].

Ordinarily when a patient is asleep the NEPL lies in the range zero to0.3. For example, consider the histograms of FIG. 38 which show acomparison of three datasets corresponding to NEPL:

(1) Essen—OSA patients on treatment,

(2) Concord—patients being titrated, and

(3) Awake—people breathing on an AutoSet Spirit airway pressure deviceavailable from ResMed.

The graph in the right-hand side of FIG. 38 shows that awake breathershave far more breaths with values greater than (>) 0.5 than the asleeppatients who have few. Thus, a system can be implemented with ade-weighting function for a flow limitation measure basedout-of-the-ordinary, unnatural or unexpected events with respect tosleep. A suitable function based on a calculated or determinednormalized inspiratory peak location value is illustrated in the graphof FIG. 39. The function is used to increase the strength of theflow-limitation measure required to cause a rise in treatment pressureas the breath becomes more unnatural, out-of-the-ordinary orunrecognizable (e.g., weird).

In the foregoing description and in the accompanying drawings, specificterminology and drawing symbols are set forth to provide a thoroughunderstanding of the present technology. In some instances, theterminology and symbols may imply specific details that are not requiredto practice the technology. Moreover, although the technology herein hasbeen described with reference to particular embodiments, it is to beunderstood that these embodiments are merely illustrative of theprinciples and applications of the technology. It is therefore to beunderstood that numerous modifications may be made to the illustrativeembodiments and that other arrangements may be devised without departingfrom the spirit and scope of the technology.

For example, the desired flow limitation detection and/or treatmentsystem can be based on other techniques for pattern recognition such astaking each inspiration and interpolating it over a grid of as manypoints as required to maintain important frequency information. Forexample, each inspiration may be interpolated over a grid of 65 points.A large set of training data may be developed with the different typesof obstructed waveforms that can be recorded based on clinicalevaluations. The waveforms may be pre-classified to categories such asmild, moderate and severe or other such category as desired. The 65points of each waveform may then be input into a classifier for training(such as a neural network, support vector machine or other) and using anappropriate algorithm, such as one based on a genetic algorithm,arbitrary boundaries can be defined in the 65 dimensional space betweenthe various categories of obstruction. Such a system would then becapable of classifying any inspiratory waveform measured in a patientagainst the metric of the classifier and used in a control system fortreatment of the patient.

Some potential issues for consideration with the approach are asfollows:

1. The “curse of dimensionality” refers to the exponential growth ofhypervolume as a function of dimensionality. In other words, as thenumber of dimensions of our input space grow so the number of trainingvectors required to “cover” that space adequately grows exponentially.Covering 65 dimensions could present issues for the speed of thetechnology.

2. Pre-classifying waveforms as obstructive (and to what degree) isproblematical and probably has a high inter-observer variability. In theabsence of raising the CPAP pressure to observe a waveform change suchas “round up”, it is difficult to determine whether obstruction actuallyexists. A reliable measure of effort, such as oesophageal pressure, canhelp with the detection issue but the problem of classifying such datain the determination can still be tricky. For example, REM sleep canproduce different and unexpected waveforms.

3. The training phase would require “significant” numerical resourcesand lots of processor cycles.

4. The resulting classifier might be difficult for anyone to interpretand numerically intensive to run on an embedded system (depending, forexample, on how many neurones we ended up with if using a neuralnetwork).

5. In order to test the resulting classifier we might need to feed itwith the sleep studies everyone on the planet.

However, one way to reduce the complexity of the system is to limit theinformation fed into it to only that which is “interesting”. Thecalculation of particular features, such as the flattening index, doesjust that; it acts as a form of compression of the signal.

1. A method of a controller for determining a treatment setting in arespiratory treatment device: receiving, by the controller, datarepresenting a measure of respiratory flow obtained by a sensor; fromthe data representing the measure of respiratory flow, determining ashape index representing a degree of partial obstruction; from the datarepresenting the measure of respiratory flow, determining a ventilationmeasure representing a degree of change in ventilation; and calculatinga treatment setting as a proportional function of both the degree ofpartial obstruction and the degree of change in ventilation.
 2. Themethod of claim 1 wherein the shape index is determined from a number ofbreaths in a range from 1 to 3 breaths.
 3. The method of claim 1 whereinthe shape index is an M-shape breath index.
 4. The method of claim 1wherein the controller applies the treatment setting to set anauto-titrating respiratory treatment device.
 5. The method of claim 1wherein the controller operates the respiratory treatment device tocontrol a treatment with the treatment setting.
 6. The method of claim 5wherein the treatment setting is a flow control setting.
 7. The methodof claim 5 wherein the treatment setting is a treatment pressure.
 8. Themethod of claim 1 wherein the proportional function comprises a flowlimitation measure, the flow limitation measure being a fuzzy logic flowlimitation measure derived from a fuzzy logic algorithm.
 9. An apparatusfor respiratory treatment comprising: a sensor to determine a measure ofrespiratory flow; and a processor configured to: (a) determine from themeasure of respiratory flow a shape index representing a degree ofpartial obstruction, (b) determine from the measure of respiratory flowa ventilation measure representing a degree of change in ventilation,and (c) derive a treatment setting as a proportional function of boththe degree of partial obstruction and the degree of change inventilation.
 10. The apparatus of claim 9 wherein the shape index isdetermined by the processor from a number of breaths in a range from 1to 3 breaths.
 11. The apparatus of claim 9 wherein the shape index is anM-shape index.
 12. The apparatus of claim 9 wherein the apparatuscomprises an auto-titrating respiratory treatment device.
 13. Theapparatus of claim 9 further comprising: a flow generator configured toprovide respiratory treatment, wherein the processor is configured tocontrol generation of the treatment with the treatment setting.
 14. Theapparatus of claim 13 wherein the treatment setting is a flow controlsetting.
 15. The apparatus of claim 14 wherein the apparatus comprisesan auto-titrating respiratory treatment device.
 16. The apparatus ofclaim 13 wherein the treatment setting is a treatment pressure.
 17. Theapparatus of claim 16 wherein the apparatus comprises an auto-titratingrespiratory treatment device.
 18. The apparatus of claim 9 wherein theproportional function comprises a flow limitation measure, the flowlimitation measure being a fuzzy logic flow limitation measure derivedfrom a fuzzy logic algorithm.
 19. An apparatus for respiratory treatmentcomprising: means for determining a measure of respiratory flow; meansfor determining a shape index representing a degree of partialobstruction from the measure of respiratory flow; means for determininga ventilation measure representing a degree of change in ventilationfrom the measure of respiratory flow; and means for deriving a treatmentsetting as a proportional function of both the degree of partialobstruction and the degree of change in ventilation.
 20. The apparatusof claim 19 further comprising: means for generating and providing arespiratory treatment to a patient in response to the derived treatmentsetting, wherein the apparatus comprises an auto-titrating respiratorytreatment device.
 21. The apparatus of claim 19 wherein the proportionalfunction comprises a flow limitation measure, the flow limitationmeasure being a fuzzy logic flow limitation measure derived from a fuzzylogic algorithm.